<template>
    <div class="minehurg">
      <div class="myinfo">
        <img :src="headimgurl" alt="">
        <span>{{nickname}}</span>
      </div>
      <MineList></MineList>
    </div>
</template>

<script>
import MineList from './components/MineList'
import Tabbar from '@/components/Tabbar'
import * as fetch from '@/api/fetch'

export default {
  name: 'Mine',
  data () {
    return {
      headimgurl: '',
      nickname: ''
    }
  },
  methods: {
    async getUserInfo () {
      const res = await fetch.getUserInfo()
      console.log(res)
      if (res.errcode == 0) {
        this.headimgurl = res.data[0].headimgurl
        this.nickname = res.data[0].nickname
      }
    }
  },
  components: {
    MineList,
    Tabbar
  },
  mounted () {
    this.getUserInfo()
  }
}
</script>

<style lang="less" scoped>
  @import '~less/variable.less';
  @import '~less/mixins.less';
  .minehurg {
    .h100();
    .myinfo {
      width: 100%;
      height: 13rem;
      background: #187a72;
      display: flex;
      justify-content: center;
      align-items: center;
      flex-direction: column;

      img {
        width: 6rem;
        height: 6rem;
        border-radius: 50%;
        border: 1.5px solid white;
        margin-top: -1rem;
      }

      span {
        font-size: 1rem;
        color: white;
        margin-top: 1rem;
      }
    }
  }
</style>
